package com.inspur.jxpcxt.service;

import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;

import org.apache.http.client.HttpClient;
import org.apache.http.impl.client.DefaultHttpClient;

import com.inspur.jxpcxt.constants.ServerConstants;
import com.inspur.jxpcxt.utils.CommonService;


public class LoginService {
	@SuppressWarnings("deprecation")
	public static String LoginByClientGet(String sno,String pswd){
				//创建HttpClient对象
				HttpClient client = new DefaultHttpClient();
				//拼装路径
				String path = null;
				try {
					path = "http://"+ServerConstants.SERVER_IP+":8080/Web/LoginServlet?sno="
							+URLEncoder.encode(sno)
							+"&pswd="
							+URLEncoder.encode(pswd)
							+"&service="
							+URLEncoder.encode(ServerConstants.SERVER_LOGIN_SERVICE,"UTF-8");
				} catch (UnsupportedEncodingException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
					return "";
				}
				return CommonService.serviceRequest(path, client);
	}
}
